function queryString(query) {
	var search = window.location.search + '';
	if (search.charAt(0) != '?') {
		return undefined;
	}
	else {
		search = search.replace('?', '').split('&');
		for (var i = 0; i < search.length; i++) {
			if (search[i].split('=')[0] == query) {
				return decodeURI(search[i].split('=')[1]);
			}
		}
		return undefined;
	}
};

$(function() {
	$.get("../datas/urls.json",function(json){
		var uri = decodeURIComponent(queryString("uri"));
		var html = "";
		var obj = json[uri];
		for(var p in obj){
			if('count' != p){
				html += "<a href='{l}' target='_blank'>{n}</a>".replace(/{l}/,p).replace(/{n}/,obj[p]);
				html += "<br/>";
			}
		}
		$('body').html(html);
	});
});
